home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / ib.638 < prev    next >
Text File  |  1992-02-06  |  2KB  |  52 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f2\fmodern Courier;\f1\fswiss Helvetica;}
  2. \paperw11760
  3. \paperh7200
  4. \margl120
  5. \margr120
  6. {\colortbl\red0\green0\blue0;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ul0\fs28 make dependencies header files\
  8. \
  9. Q:  How can I get 
  10. \b make
  11. \b0  to recompile my program when I've only edited one of the .h files? I've changed the class by editing the interface file, but it thinks the program is up to date.  \
  12. \
  13. Q: Is there an easy way to recursively trace all the header files that my source file depends on?\
  14. \
  15. A:  You can of course fool 
  16. \b make
  17. \b0  by typing "
  18. \f2 touch foo.m" 
  19. \f0 before compiling, but that's not a very elegant solution. What you need is a 
  20. \b Makefile.dependencies
  21. \b0  file.  This can be easily generated by typing "
  22. \f2 make depend
  23. \f0 ", assuming your Makefile was generated by Interface Builder.  Makefile.dependencies will contain all the dependencies, listing the files included by your .m files. A typical line of this file will look something like:\
  24.  
  25. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f2\fc0 \
  26. MyClass.o : MyClass.m MyClass.h 
  27. \f0 \
  28.  
  29. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600 \
  30. From then on, when you do a 
  31. \b make 
  32. \b0 in this directory, whether from Interface Builder or a shell, it will check this file before deciding the program is up to date.  Makefile.dependencies can also be edited by hand, if for any reason 
  33. \b make depend 
  34. \b0 doesn't do what you need. If you add new files to your project, you should delete Makefile.dependencies
  35. \b  
  36. \b0 and regenerate it before recompiling.\
  37. \
  38. In answer to the second question,
  39. \b  cc
  40. \b0  has a -M flag that can be useful if you want to see a listing of 
  41. \b all 
  42. \b0 the header files your source file depends on, including the appkit and operating system files.  See the man page.\
  43. \
  44. QA638\
  45.  
  46. \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\f1\fs24\fc0 \
  47.  
  48. \f0\fs28 Valid for 2.0
  49. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600 \
  50. \
  51.  
  52.